<%@page import="com.bilgeadam.mvc.model.Product"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">
<title>Insert title here</title>
</head>
<body>
	<h1>Ürünler Sayfası</h1>
	<table class="pure-table">
		<thead>
			<tr>
				<th>#</th>
				<th>Ürün Adı</th>
				<th>Fiyatı</th>
			</tr>
		</thead>
		<tbody>
			<%
				List<Product> products = (List<Product>) request.getAttribute("products");
				for (int i = 0; i < products.size(); i++) {
					Product currentProduct = products.get(i);
					if (i % 2 == 1) {
						out.print("<tr class='pure-table-odd'>");
					} else {
						out.print("<tr>");
					}
					{
						out.print("<td>" + i + "</td>");
						out.print("<td>" + currentProduct.getName() + "</td>");
						out.print("<td>" + currentProduct.getPrice() + "</td>");
					}
					out.print("<tr>");
				}
			%>
		</tbody>
	</table>
</body>
</html>